class Solution:
    def search(self, nums: List[int], target: int) -> int:
        a=0
        b=len(nums)-1
        while a<=b:
            c=int(a+(b-a)/2)
            if nums[c]>target:
                b=c-1
            elif nums[c]<target:
                a=c+1
            else:
                return c
        return -1